#ifndef TRACT_ALG_SERVICE
#define TRACT_ALG_SERVICE
#include "jni.h"
#include <math.h>
#include <map>
#include "dto/TractDTO.h"
using namespace std;

const int MAX_ITERATIONS=10000;
const int MAX_PARALLEL_ITERATIONS=10000;

TractDTO* createTractDTO(JNIEnv *env,jobject tractDTO);

double* createTractArray(JNIEnv *env,TractDTO tract,jdoubleArray result);
map<double,double> createTractArray(TractDTO* tract);

//make private
double computeVoltageConsistentTract(TractDTO tract, double current);

map<double,double> createConsistentTwoTractsArray(TractDTO tract1,TractDTO tract2);

map<double,double> createParallelTwoTractsArray(map<double,double> tractMap1,map<double,double> tractMap2);

#endif